import localForage from "localforage";

function setStorageSync(KEY, VALUE) {
	// console.log(KEY,VALUE)
    localStorage.setItem(KEY, VALUE);
}
function getStorageSync(KEY) {
	// return await localforage.getItem(KEY);
    return localStorage.getItem(KEY);
}
function removeStorageSync(KEY) {
    localStorage.removeItem(KEY);
}

// 保存做题记录
async function setLocalForage(KEY, VALUE) {
	// console.log(KEY,VALUE)
    localForage.setItem(KEY, VALUE).catch(err => {
		console.error(err)
	});
}
// 获取做题记录
async function getLocalForage(KEY) {
	return await localForage.getItem(KEY);
}
// 清除做题记录
async function removeLocalForage(KEY) {
    localForage.removeItem(KEY).catch(err => {
		console.error(err)
	});
}


export {
	setStorageSync,
	getStorageSync,
	removeStorageSync,
	setLocalForage,
	getLocalForage,
	removeLocalForage
}